import {localeProps} from '../../utils';

const label = '提示';
const name = 'a-alert';

export default {
  icon: 'icon-alert',
  label,
  name,
  rule({t}) {
    return {
      type: name,
      props: {
        title: name,
        type: 'success',
        closable: true
      },
      children: []
    };
  },
  props(_, {t}) {
    return localeProps(t, name + '.props', [
      {
        type: 'input',
        field: 'title',
        title: '标题'
      },
      {
        type: 'select',
        field: 'type',
        title: '主题',
        options: [
          {
            label: 'success',
            value: 'success'
          },
          {
            label: 'warning',
            value: 'warning'
          },
          {
            label: 'info',
            value: 'info'
          },
          {
            label: 'error',
            value: 'error'
          },
          {
            label: 'normal',
            value: 'normal'
          }
        ]
      },
      {
        type: 'switch',
        field: 'closable',
        title: '是否可关闭',
        value: true
      },
      {
        type: 'switch',
        field: 'center',
        title: '文字是否居中',
        value: false
      },
      {
        type: 'switch',
        field: 'showIcon',
        title: '是否显示图标',
        value: true
      }
    ]);
  }
};
